package com.java.innerchengyuan;

public class Student {
	/**
	 * 成员内部类
	 */
	// 属性
	// 成员变量
	private String stuName;
	private String stuSex;
	private double stuScore;

	// 成员内部类
	public class StuFamily {
		// 属性
		private String stuMother;
		private String stuFather;
		private String stuAddress;

		// 输出家庭信息方法
		public String dostuFamily() {
			String str = "学生" + stuName + "家庭信息为：" + toString();
			return str;
		}

		// 构造方法
		public StuFamily(String stuMother, String stuFather, String stuAddress) {
			super();
			this.stuMother = stuMother;
			this.stuFather = stuFather;
			this.stuAddress = stuAddress;
		}

		public StuFamily() {
			super();
			// TODO Auto-generated constructor stub
		}

		// toString方法
		@Override
		public String toString() {
			return "stuFamily [stuMother=" + stuMother + ", stuFather=" + stuFather + ", stuAddress=" + stuAddress
					+ "]";
		}
		// getter，setter

		public String getStuMother() {
			return stuMother;
		}

		public void setStuMother(String stuMother) {
			this.stuMother = stuMother;
		}

		public String getStuFather() {
			return stuFather;
		}

		public void setStuFather(String stuFather) {
			this.stuFather = stuFather;
		}

		public String getStuAddress() {
			return stuAddress;
		}

		public void setStuAddress(String stuAddress) {
			this.stuAddress = stuAddress;
		}

	}

	/**
	 * 行为
	 */
	// 学习行为
	public void doStuding() {
		System.out.println(this.stuName + " is studing...");
	}

	// 打印行为，若内部类不是public，是private,则只能调用此方法
	public void printMeFamily() {
		// 定义一个成员内部类的实例对象
		StuFamily stuF = new StuFamily("张三妈妈", "张三爸爸", "天津西青");
		System.out.println(stuF.dostuFamily());
	}
	// 构造方法

	public Student(String stuName, String stuSex, double stuScore) {
		super();
		this.stuName = stuName;
		this.stuSex = stuSex;
		this.stuScore = stuScore;
	}

	public Student() {
		super();
		// TODO Auto-generated constructor stub
	}
	// getter，setter

	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public String getStuSex() {
		return stuSex;
	}

	public void setStuSex(String stuSex) {
		this.stuSex = stuSex;
	}

	public double getStuScore() {
		return stuScore;
	}

	public void setStuScore(double stuScore) {
		this.stuScore = stuScore;
	}

}
